Skip to content

feat: φ-optimized FMA operations for GF16#55

Closed
gHashTag wants to merge 1 commit into
mainfrom
feat/issue-4-gf16-phi-fma
Closed

feat: φ-optimized FMA operations for GF16#55
gHashTag wants to merge 1 commit into
mainfrom
feat/issue-4-gf16-phi-fma

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Summary

Implements issue #4 — φ-optimized fused multiply-add operations.

GF16 struct additions (src/formats/golden_float16.zig):

  • fma(a,b,c) — fused multiply-add: a×b+c (single rounding)
  • fms(a,b,c) — fused multiply-subtract: a×b-c
  • fnma(a,b,c) — fused negated multiply-add: c-a×b
  • phiFma(a,b,c) — φ-weighted FMA with golden-ratio scaling (×φ²)
  • phiDot(a,b) — φ-optimized dot product over slices

C-ABI exports (src/c_abi.zig): gf16_fms, gf16_fnma, gf16_phi_fma

C header (src/c/gf16.h): declares all new functions

Tests: 5 new tests for FMA, FMS, FNMA, phiFMA, phiDot

Closes #4

Add fused arithmetic to GF16 struct:
- fma(a,b,c): a*b+c (single rounding)
- fms(a,b,c): a*b-c
- fnma(a,b,c): c-a*b (negated FMA)
- phiFma(a,b,c): φ-weighted FMA with golden-ratio scaling
- phiDot(a,b): φ-optimized dot product over slices

Export via C-ABI (gf16_fms, gf16_fnma, gf16_phi_fma) and
declare in gf16.h header. Add 5 new unit tests.

Closes #4
@gHashTag
Copy link
Copy Markdown
Owner Author

Superseded by #57 (FMA already merged to main in e2c100d).

@gHashTag gHashTag closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IIGLA-GF16: Implement φ-optimized FMA operations

1 participant